Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(router/atc): iterate and append items properly when splitting routes #13045

Closed
wants to merge 1 commit into from

Conversation

chronolaw
Copy link
Contributor

@chronolaw chronolaw commented May 19, 2024

Summary

We iterate items from 1 to routes_and_services_count, but in the loop
routes_and_services_count may be changed, it is not our expected.

The variable routes_and_services_count should not be changed,
so we could use another variable appending_index, which has the same effect.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix #[issue number]

@github-actions github-actions bot added core/router cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels May 19, 2024
@chronolaw chronolaw requested a review from bungle May 19, 2024 07:20
@chronolaw chronolaw changed the title refactor(router/atc): iterate items properly when splitting routes refactor(router/atc): iterate and append items properly when splitting routes May 19, 2024
@bungle
Copy link
Member

bungle commented May 20, 2024

it is not a bug, for i=x, variable is evaluated only once

@chronolaw
Copy link
Contributor Author

Got, thanks.

@chronolaw chronolaw closed this May 20, 2024
@chronolaw chronolaw deleted the fix/count_route_and_service_properly branch May 20, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/router size/XS skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants